package Ex1;

import java.sql.SQLOutput;
import java.util.Arrays;

/**
 * @author ZZQ
 * @PackageName: Ex1
 * @ClassName: Ex100
 * @Description:
 * @date 2021/1/16 16:37
 */
public class Ex100 {
    public static void main(String[]args){
        System.out.println("前100项和为" + sum(100));

    }
    public static double sum(int n) {
        if (n == 1) {
            return 1;
        }
        return 1.0 / n + sum(n - 1);
    }

}








